﻿#ifndef POINTTRACKWINDOW_H
#define POINTTRACKWINDOW_H

#include <QWidget>
#include <QList>
#include <QPixmap>
#include "utils/touch/TouchPoint.h"

class PointTrackWindow : public QWidget
{
    Q_OBJECT
public:
    explicit PointTrackWindow(QWidget *parent = nullptr);

    void setPoints(const QList<TouchPoint> &points);  // 设置点并绘制
    void setOpacity(uint8_t opacity);

    void clear();
protected:
    void paintEvent(QPaintEvent *event) override;
    void resizeEvent(QResizeEvent *event) override;

private:
    QList<TouchPoint> m_lastPoints;
    QPixmap m_canvas;

    uint8_t m_opacity = 100; // 0不透明，100全透明

    QColor colorForIndex(int index) const;
};

#endif // POINTTRACKWINDOW_H
